﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;

namespace Sugata.SolutionFoldersOrganizer
{
    partial class SolutionFoldersOrganizerPackage
    {

        private bool isWorking = false;

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "Microsoft.Samples.VisualStudio.MenuCommands.MenuCommandsPackage.OutputString(System.String)")]
        private void OrganizeSolutionFolders(object caller, EventArgs args)
        {

            if (!isWorking)
            {

                isWorking = true;

                Common.OutputString("Looking for projects...");

                var solutionWorker = new SolutionWorker(
                                            GetService(typeof(SVsSolution)) as IVsSolution);

                Common.OutputString("Done ;)");

                isWorking = false;

            }
            else
            {
                Common.OutputString("Busy right now!");
            }

        }

    }
}
